package org.haredot.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.haredot.dto.DepartDTO;
import org.haredot.entity.Depart;
import org.haredot.entity.User;
import org.haredot.vo.DepartVo;

import java.util.List;

@Mapper
public interface DepartMapper {

    Depart findDepartByName(String name);

    Depart findDepartByCode(String code);

    int saveDepart(DepartVo departVo);

    List<DepartDTO> findOneLevelDeparts();

    List<DepartDTO> findDepartByPid(Long pid);

    int modifyDepartById(Depart depart);

    Depart findDepartById(Long id);

    int deleteById(Long departId);

    List<DepartDTO> findRecursiveDeparts();

    List<User> findUsersByDepartId(Long departId);
}